<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>申请需求延迟！</title>
		<script src="<s:url value="/script/jquery_last.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/formValidator.js"/>" type="text/javascript" charset="UTF-8"></script>
<script src="<s:url value="/script/formValidatorRegex.js"/>" type="text/javascript" charset="UTF-8"></script>
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<link rel="stylesheet" href="<s:url value="/css/validator.css"/>">
<script>
</script>
	</head>

	<body  leftmargin="0" topmargin="0">
	<table width="100%" border="0" cellspacing="0" cellpadding="0"
		align="center">
		<tr>
			<td width="20%" valign="top">
				<table width="100%" border="0" cellspacing="0"
					cellpadding="0" align="center" >
					<tr>
						<td valign="top" align="center">
							<br>
							<s:form action="saveReqDelay.action" namespace="/bpm"   >
							<input type="hidden" name="businessRequest.id"
								value="${businessRequest.id}">
							<table width=98% border="0" cellspacing="0" cellpadding="0">
								
								<tr>
									<td  >
									<s:property value="#returnMsg" />
										<s:if test="#returnMsg==view" >
										<TABLE width="98%" cellSpacing=1 cellPadding=0
											align="center">
											<TR height=30>
												<TD align=left width="10%">
													<input type="submit"  value="保 存" onclick="return check();">
													<input type="button" value="取 消" onClick="window.close();">
												</TD>
											</TR>
										</table>
										
										<table width="98%" border="0" cellspacing="0"
											cellpadding="7" align="center" class=tablecolor2>
											<tr>
												<td width="19%" bgcolor="D6E3FA">
													<div align="right">
														<font color="red">*</font>
														延 迟 原 因：
													</div>
												</td>
												<td width="81%">
													<s:textarea name="reqDelay.delayReason"
														theme="css_xhtml" cols="50" rows="6" />
												</td>
											</tr>
											<tr>
												<td width="19%" bgcolor="D6E3FA">
													<div align="right">
														<font color="red">*</font>
														延迟时长：
													</div>
												</td>
												<td width="81%">
														<input type="text" name="reqDelay.delayTime" size="5" value="${reqDelay.delayTime }"/>
														周
												</td>
											</tr>
											<tr>
												<td width="19%" bgcolor="D6E3FA">
													<div align="right">
														<font color="red">*</font>
														工作时限原值：
													</div>
												</td>
												<td width="81%">
												${empty transactProcessStatus.currProcessConfigDetail.timeLimit? 0 :transactProcessStatus.currProcessConfigDetail.timeLimit}
												<input type="hidden" name="reqDelay.oriVal" size="5" value="${reqDelay.oriVal }"/>
																天
												</td>
											</tr>
											
									</table>
									</s:if>
									
							</s:form>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
	</body>
</html>



<script>
	function check(){
		if(document.all["reqDelay.delayReason"]&&document.all["reqDelay.delayReason"].value==""){
			alert("请输入延迟原因！");
			return false;
		}
		document.all["reqDelay.delayTime"].value=document.all["reqDelay.delayTime"].value.trim();
		if(document.all["reqDelay.delayTime"]&&document.all["reqDelay.delayTime"].value==""){
			alert("请输入延迟时长！");
			return false;
		}
		if(!IsInteger(document.all["reqDelay.delayTime"].value)){
			alert("延迟时长只能输入数字！");
			return false;
		}
		
		return true;
	}
function IsInteger(fData)
{
	if ((isNaN(fData)) || (fData.indexOf(".")!=-1) || (fData.indexOf("-")!=-1))
		return false;
	return true;
}
String.prototype.trim = function() {   
  var str = this,   
  whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';   
  for (var i = 0,len = str.length; i < len; i++) {   
    if (whitespace.indexOf(str.charAt(i)) === -1) {   
      str = str.substring(i);   
      break;   
    }   
  }   
  for (i = str.length - 1; i >= 0; i--) {   
    if (whitespace.indexOf(str.charAt(i)) === -1) {   
      str = str.substring(0, i + 1);   
      break;   
    }   
  }   
  return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';   
}   
</script>
